package com.rajaev.dtu.tractor.domain.service;

import com.rajaev.dtu.tractor.app.service.BatteryElectricService;
import com.rajaev.dtu.tractor.domain.entity.BatteryElectricLog;
import com.rajaev.dtu.tractor.domain.repository.mysql.BatteryElectricDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class BatteryElectricServiceDomain implements BatteryElectricService {

    @Autowired
    private BatteryElectricDao batteryElectricDao;

    @Override
    public Integer addBatteryElectricLog(BatteryElectricLog batteryElectricLog) {
        return batteryElectricDao.addBatteryElectricLog(batteryElectricLog);
    }

    @Override
    public BatteryElectricLog selectChargingLog(String vin) {
        return batteryElectricDao.queryChargingByVin(vin);
    }


    @Override
    public BatteryElectricLog selectNotOveredLog(String vin) {
        return batteryElectricDao.selectNotOveredLogByVin(vin);
    }

    @Override
    public void updateBatteryElectricLog(BatteryElectricLog batteryElectricLog) {
        batteryElectricDao.updateBatteryElectricLog(batteryElectricLog);
    }

    @Override
    public BatteryElectricLog selectDisChargingLog(String vin) {
        return batteryElectricDao.queryDischargingByVin(vin);
    }


    @Override
    public List<BatteryElectricLog> selectChargingBatteryLog() {
        return batteryElectricDao.queryChargingLog();
    }

    @Override
    public List<BatteryElectricLog> selectDisChargingBatteryLog() {
        return batteryElectricDao.queryDischargingLog();
    }
}
